﻿using System;
using System.Collections.Generic;
using System.Text;

namespace BLL
{
    /// <summary>
    /// 定义发布消息的委托
    /// </summary>
    /// <param name="sender">发布者</param>
    /// <param name="receiver">接收者</param>
    /// <param name="msg">消息</param>
    
    public delegate void Send(object sender, object receiver,object msg);
    /// <summary>
    /// 观察者的中间模块组建
    /// </summary>
    public class MiddleModule
    {
        /// <summary>
        ///消息发布的事件
        /// </summary>
        public static event Send eventSend;

        public static void SendMessage(object sender, object receiver, object msg)
        {

            if (eventSend != null)
            {
                eventSend(sender,receiver, msg);
            }
        }
    }
}